import { AccessibilityRulesConfig, ComplexityRulesConfig, CorrectnessRulesConfig, NurseryRulesConfig, PerformanceRulesConfig, SecurityRulesConfig, StyleRulesConfig, SuspiciousRulesConfig } from "./config";

export interface BaseRuleInfo {
    descCn: string;
    descEn: string;
    url: string;
    recommend: boolean;
}

export interface AccessibilityRuleInfo extends BaseRuleInfo {
    id: keyof AccessibilityRulesConfig;
}

export const AccessibilityRuleList: AccessibilityRuleInfo[] = [
    {
        id: "noAccessKey",
        descCn: "强制在任何HTML元素上都不使用accessKey属性。",
        descEn: "Enforce that the accessKey attribute is not used on any HTML element.",
        url: "https://docs.rome.tools/lint/rules/noaccesskey/",
        recommend: false,
    },
    {
        id: "noAutofocus",
        descCn: "避免使用autoFocus属性",
        descEn: "Avoid the autoFocus attribute",
        url: "https://docs.rome.tools/lint/rules/noautofocus/",
        recommend: true,
    },
    {
        id: "noBlankTarget",
        descCn: "不允许不带rel=“noreferrer”的target=“_blank”属性",
        descEn: "Disallow target=“_blank” attribute without rel=“noreferrer”",
        url: "https://docs.rome.tools/lint/rules/noblanktarget/",
        recommend: true,
    },
    {
        id: "noDistractingElements",
        descCn: "强制不使用分散注意力的元素。",
        descEn: "Enforces that no distracting elements are used.",
        url: "https://docs.rome.tools/lint/rules/nodistractingelements/",
        recommend: true,
    },
    {
        id: "noHeaderScope",
        descCn: "请检查scope属性是否仅用于th元素。",
        descEn: "Check that the scope attribute is only used on th elements.",
        url: "https://docs.rome.tools/lint/rules/noheaderscope/",
        recommend: true,
    },
    {
        id: "noPositiveTabindex",
        descCn: "禁止在tabIndex属性上使用正整数",
        descEn: "Prevent the usage of positive integers on tabIndex property",
        url: "",
        recommend: true,
    },
    {
        id: "useAltText",
        descCn: "图像或区域的替代文本有助于依靠屏幕读者来理解图像的目的和上下文。",
        descEn: "It asserts that alternative text to images or areas, help to rely on to screen readers to understand the purpose and the context of the image.",
        url: "https://docs.rome.tools/lint/rules/usealttext/",
        recommend: true,
    },
    {
        id: "useAnchorContent",
        descCn: "强制锚元素具有内容，并且屏幕阅读器可以访问该内容。",
        descEn: "Enforce that anchor elements have content and that the content is accessible to screen readers.",
        url: "https://docs.rome.tools/lint/rules/useanchorcontent/",
        recommend: true,
    },
    {
        id: "useButtonType",
        descCn: "强制元素按钮使用属性类型",
        descEn: "Enforces the usage of the attribute type for the element button",
        url: "https://docs.rome.tools/lint/rules/usebuttontype/",
        recommend: true,
    },
    {
        id: "useHtmlLang",
        descCn: "强制该html元素具有lang属性。这允许用户选择默认语言之外的其他语言。",
        descEn: "Enforce that html element has lang attribute. This allows users to choose a language other than the default.",
        url: "https://docs.rome.tools/lint/rules/usehtmllang/",
        recommend: true,
    },
    {
        id: "useKeyWithClickEvents",
        descCn: "强制将onClick鼠标事件与onKeyUp、onKeyDown或onKeyPress键盘事件一起使用。",
        descEn: "Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.",
        url: "https://docs.rome.tools/lint/rules/usekeywithclickevents/",
        recommend: true,
    },
    {
        id: "useKeyWithMouseEvents",
        descCn: "强制只使用键盘的用户在onMouseOver/onMouseOut的同时使用onFocus/onBlur。重要的是要考虑到不能使用鼠标、使用辅助技术或读屏器的身体残疾用户。",
        descEn: "Enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur for keyboard-only users. It is important to take into account users with physical disabilities who cannot use a mouse, who use assistive technology or screenreader.",
        url: "https://docs.rome.tools/lint/rules/usekeywithmouseevents/",
        recommend: true,
    },
    {
        id: "useValidAnchor",
        descCn: "强制所有锚点都是有效的，并且它们是可导航的元素。",
        descEn: "Enforce that all anchors are valid, and they are navigable elements.",
        url: "https://docs.rome.tools/lint/rules/usevalidanchor/",
        recommend: true,
    },
];

export interface ComplexityRuleInfo extends BaseRuleInfo {
    id: keyof ComplexityRulesConfig;
}

export const ComplexityRuleList: ComplexityRuleInfo[] = [
    {
        id: "noExtraBooleanCast",
        descCn: "不允许不必要的布尔型强制转换",
        descEn: "Disallow unnecessary boolean casts",
        url: "https://docs.rome.tools/lint/rules/noextrabooleancast/",
        recommend: true,
    },
    {
        id: "noMultipleSpacesInRegularExpressionLiterals",
        descCn: "不允许在正则表达式文字中不清楚地使用多个空格字符",
        descEn: "Disallow unclear usage of multiple space characters in regular expression literals",
        url: "https://docs.rome.tools/lint/rules/nomultiplespacesinregularexpressionliterals/",
        recommend: true,
    },
    {
        id: "noUselessFragments",
        descCn: "不允许不必要的碎片",
        descEn: "Disallow unnecessary fragments",
        url: "https://docs.rome.tools/lint/rules/nouselessfragments/",
        recommend: false,
    },
    {
        id: "useFlatMap",
        descCn: "当map().flat()一起使用时，促进.flatMap()的使用。",
        descEn: "Promotes the use of .flatMap() when map().flat() are used together.",
        url: "https://docs.rome.tools/lint/rules/useflatmap/",
        recommend: true,
    },
    {
        id: "useOptionalChain",
        descCn: "强制使用简洁的可选链，而不是链接的逻辑表达式。",
        descEn: "Enforce using concise optional chain instead of chained logical expressions.",
        url: "https://docs.rome.tools/lint/rules/useoptionalchain/",
        recommend: true,
    },
    {
        id: "useSimplifiedLogicExpression",
        descCn: "放弃逻辑表达式中的冗余项。",
        descEn: "Discard redundant terms from logical expressions.",
        url: "https://docs.rome.tools/lint/rules/usesimplifiedlogicexpression/",
        recommend: false,
    },
];

export interface CorrectnessRuleInfo extends BaseRuleInfo {
    id: keyof CorrectnessRulesConfig;
}

export const CorrectnessRuleList: CorrectnessRuleInfo[] = [
    {
        id: "noChildrenProp",
        descCn: "防止把children当作属性使用。",
        descEn: "Prevent passing of children as props.",
        url: "https://docs.rome.tools/lint/rules/nochildrenprop/",
        recommend: true,
    },
    {
        id: "noConstAssign",
        descCn: "防止重新分配常量变量。",
        descEn: "Prevents from having const variables being re-assigned.",
        url: "https://docs.rome.tools/lint/rules/noconstassign/",
        recommend: true,
    },
    {
        id: "noConstructorReturn",
        descCn: "不允许从构造函数返回值。",
        descEn: "Disallow returning a value from a constructor.",
        url: "https://docs.rome.tools/lint/rules/noconstructorreturn/",
        recommend: true,
    },
    {
        id: "noEmptyPattern",
        descCn: "不允许空的销毁模式。",
        descEn: "Disallows empty destructuring patterns.",
        url: "https://docs.rome.tools/lint/rules/noemptypattern/",
        recommend: true,
    },
    {
        id: "noNewSymbol",
        descCn: "不允许使用Symbol对象的新运算符",
        descEn: "Disallow new operators with the Symbol object",
        url: "https://docs.rome.tools/lint/rules/nonewsymbol/",
        recommend: true,
    },
    {
        id: "noPrecisionLoss",
        descCn: "不允许丢失精度的文字数字",
        descEn: "Disallow literal numbers that lose precision",
        url: "https://docs.rome.tools/lint/rules/noprecisionloss/",
        recommend: true,
    },
    {
        id: "noRenderReturnValue",
        descCn: "防止使用React.render的返回值。",
        descEn: "Prevent the usage of the return value of React.render.",
        url: "https://docs.rome.tools/lint/rules/norenderreturnvalue/",
        recommend: true,
    },
    {
        id: "noSetterReturn",
        descCn: "不允许从setter返回值",
        descEn: "Disallow returning a value from a setter",
        url: "https://docs.rome.tools/lint/rules/nosetterreturn/",
        recommend: true,
    },
    {
        id: "noStringCaseMismatch",
        descCn: "不允许将修改字符串大小写的表达式与不兼容的值进行比较。",
        descEn: "Disallow comparison of expressions modifying the string case with non-compliant value.",
        url: "https://docs.rome.tools/lint/rules/nostringcasemismatch/",
        recommend: true,
    },
    {
        id: "noUndeclaredVariables",
        descCn: "防止使用文档中未声明的变量",
        descEn: "Prevents the usage of variables that haven’t been declared inside the document",
        url: "https://docs.rome.tools/lint/rules/noundeclaredvariables/",
        recommend: false,
    },
    {
        id: "noUnnecessaryContinue",
        descCn: "避免使用不必要的continue",
        descEn: "Avoid using unnecessary continue",
        url: "",
        recommend: false,
    },
    {
        id: "noUnreachable",
        descCn: "禁止无法访问的代码",
        descEn: "Disallow unreachable code",
        url: "https://docs.rome.tools/lint/rules/#correctness",
        recommend: true,
    },
    {
        id: "noUnsafeFinally",
        descCn: "不允许在finally块中使用控制流语句。",
        descEn: "Disallow control flow statements in finally blocks.",
        url: "https://docs.rome.tools/lint/rules/nounsafefinally/",
        recommend: true,
    },
    {
        id: "noUnusedVariables",
        descCn: "不允许使用未使用的变量。",
        descEn: "Disallow unused variables.",
        url: "https://docs.rome.tools/lint/rules/nounusedvariables/",
        recommend: false,
    },
    {
        id: "noVoidElementsWithChildren",
        descCn: "此规则防止void元素（又名自闭元素）生成子元素。",
        descEn: "This rules prevents void elements (AKA self-closing elements) from having children.",
        url: "https://docs.rome.tools/lint/rules/novoidelementswithchildren/",
        recommend: true,
    },
    {
        id: "noVoidTypeReturn",
        descCn: "不允许从返回类型为“void”的函数返回值",
        descEn: "Disallow returning a value from a function with the return type ‘void’",
        url: "https://docs.rome.tools/lint/rules/novoidtypereturn/",
        recommend: true,
    },
    {
        id: "useValidForDirection",
        descCn: "强制执行“for”循环更新子句，使计数器向正确方向移动。",
        descEn: "Enforce “for” loop update clause moving the counter in the right direction.",
        url: "https://docs.rome.tools/lint/rules/usevalidfordirection/",
        recommend: true,
    }
];

export interface PerformanceRuleInfo extends BaseRuleInfo {
    id: keyof PerformanceRulesConfig;
}

export const PerformanceRuleList: PerformanceRuleInfo[] = [
    {
        id: "noDelete",
        descCn: "不允许使用delete运算符。",
        descEn: "Disallow the use of the delete operator.",
        url: "https://docs.rome.tools/lint/rules/nodelete/",
        recommend: true,
    },
];

export interface SecurityRuleInfo extends BaseRuleInfo {
    id: keyof SecurityRulesConfig;
}

export const SecurityRuleList: SecurityRuleInfo[] = [
    {
        id: "noDangerouslySetInnerHtml",
        descCn: "防止使用JSX中危险的属性",
        descEn: "Prevent the usage of dangerous JSX props",
        url: "https://docs.rome.tools/lint/rules/nodangerouslysetinnerhtml/",
        recommend: true,
    },
    {
        id: "noDangerouslySetInnerHtmlWithChildren",
        descCn: "当DOM元素或组件同时使用children和dangerouslySetInnerHTML道具时报告。",
        descEn: "Report when a DOM element or a component uses both children and dangerouslySetInnerHTML prop.",
        url: "https://docs.rome.tools/lint/rules/nodangerouslysetinnerhtmlwithchildren/",
        recommend: true,
    },
];

export interface StyleRuleInfo extends BaseRuleInfo {
    id: keyof StyleRulesConfig;
}

export const StyleRuleList: StyleRuleInfo[] = [
    {
        id: "noArguments",
        descCn: "不允许使用arguments",
        descEn: "Disallow the use of arguments",
        url: "https://docs.rome.tools/lint/rules/noarguments/",
        recommend: true,
    },
    {
        id: "noImplicitBoolean",
        descCn: "不允许在JSX布尔属性上使用隐式真值",
        descEn: "Disallow implicit true values on JSX boolean attributes",
        url: "https://docs.rome.tools/lint/rules/noimplicitboolean/",
        recommend: false,
    },
    {
        id: "noNegationElse",
        descCn: "如果if语句有else子句，则不允许在if语句的条件下使用否定",
        descEn: "Disallow negation in the condition of an if statement if it has an else clause",
        url: "https://docs.rome.tools/lint/rules/nonegationelse/",
        recommend: false,
    },
    {
        id: "noNonNullAssertion",
        descCn: "不允许使用!后缀运算符",
        descEn: "Disallow non-null assertions using the ! postfix operator",
        url: "https://docs.rome.tools/lint/rules/nononnullassertion/",
        recommend: true,
    },
    {
        id: "noShoutyConstants",
        descCn: "不允许使用其值为其名称的大写版本的常量。",
        descEn: "Disallow the use of constants which its value is the upper-case version of its name.",
        url: "https://docs.rome.tools/lint/rules/noshoutyconstants/",
        recommend: false,
    },
    {
        id: "noUnusedTemplateLiteral",
        descCn: "如果不需要插值和特殊字符处理，则不允许使用模板文字",
        descEn: "Disallow template literals if interpolation and special-character handling are not needed",
        url: "https://docs.rome.tools/lint/rules/nounusedtemplateliteral/",
        recommend: true,
    },
    {
        id: "noVar",
        descCn: "不允许使用var",
        descEn: "Disallow the use of var",
        url: "https://docs.rome.tools/lint/rules/novar/",
        recommend: true,
    },
    {
        id: "useBlockStatements",
        descCn: "需要以下大括号约定。当一个块只包含一条语句时，JavaScript允许省略大括号。然而，许多人认为，最好不要在块周围省略大括号，即使它们是可选的，因为这会导致错误并降低代码的清晰度。",
        descEn: "Requires following curly brace conventions. JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to never omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity.",
        url: "https://docs.rome.tools/lint/rules/useblockstatements/",
        recommend: false,
    },
    {
        id: "useConst",
        descCn: "对于在声明后从未重新分配的变量，需要使用const声明。",
        descEn: "Require const declarations for variables that are never reassigned after declared.",
        url: "https://docs.rome.tools/lint/rules/useconst/",
        recommend: true,
    },
    {
        id: "useDefaultParameterLast",
        descCn: "强制将默认函数参数和可选参数设置为最后一个。",
        descEn: "Enforce default function parameters and optional parameters to be last.",
        url: "https://docs.rome.tools/lint/rules/usedefaultparameterlast/",
        recommend: true,
    },
    {
        id: "useEnumInitializers",
        descCn: "要求显式初始化每个枚举成员值。",
        descEn: "Require that each enum member value be explicitly initialized.",
        url: "https://docs.rome.tools/lint/rules/useenuminitializers/",
        recommend: true,
    },
    {
        id: "useExponentiationOperator",
        descCn: "不允许使用Math.pow而使用**运算符。",
        descEn: "Disallow the use of Math.pow in favor of the ** operator.",
        url: "https://docs.rome.tools/lint/rules/useexponentiationoperator/",
        recommend: false,
    },
    {
        id: "useFragmentSyntax",
        descCn: "此规则强制使用<>…</>而不是<Fragment>…</Fragment>。",
        descEn: "This rule enforces the use of <>…</> over <Fragment>…</Fragment>.",
        url: "https://docs.rome.tools/lint/rules/usefragmentsyntax/",
        recommend: false,
    },
    {
        id: "useNumericLiterals",
        descCn: "不允许parseInt()和Number.parseInt()使用二进制、八进制和十六进制文字",
        descEn: "Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals",
        url: "https://docs.rome.tools/lint/rules/usenumericliterals/",
        recommend: true,
    },
    {
        id: "useSelfClosingElements",
        descCn: "防止没有子级的组件使用额外的结束标记",
        descEn: "Prevent extra closing tags for components without children",
        url: "https://docs.rome.tools/lint/rules/useselfclosingelements/",
        recommend: true,
    },
    {
        id: "useShorthandArrayType",
        descCn: "在表达数组类型时，此规则提倡使用T[]简写，而不是array<T>",
        descEn: "When expressing array types, this rule promotes the usage of T[] shorthand instead of Array<T>.",
        url: "https://docs.rome.tools/lint/rules/useshorthandarraytype/",
        recommend: false,
    },
    {
        id: "useSingleCaseStatement",
        descCn: "强制switch子句只有一条语句，并发出一个快速修复程序，将语句包装在一个块中。",
        descEn: "Enforces switch clauses have a single statement, emits a quick fix wrapping the statements in a block.",
        url: "https://docs.rome.tools/lint/rules/usesinglecasestatement/",
        recommend: false,
    },
    {
        id: "useSingleVarDeclarator",
        descCn: "不允许在同一变量语句中使用多个变量声明",
        descEn: "Disallow multiple variable declarations in the same variable statement",
        url: "https://docs.rome.tools/lint/rules/usesinglevardeclarator/",
        recommend: true,
    },
    {
        id: "useTemplate",
        descCn: "比起字符串串联，模板文本更受欢迎。",
        descEn: "Template literals are preferred over string concatenation.",
        url: "https://docs.rome.tools/lint/rules/usetemplate/",
        recommend: true,
    },
    {
        id: "useWhile",
        descCn: "当不需要初始值设定项和更新表达式时，强制使用while循环而不是for循环",
        descEn: "Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed",
        url: "https://docs.rome.tools/lint/rules/usewhile/",
        recommend: true,
    },
];

export interface SuspiciousRuleInfo extends BaseRuleInfo {
    id: keyof SuspiciousRulesConfig;
}

export const SuspiciousRuleList: SuspiciousRuleInfo[] = [
    {
        id: "noArrayIndexKey",
        descCn: "禁止在键中使用数组索引。",
        descEn: "Discourage the usage of Array index in keys.",
        url: "https://docs.rome.tools/lint/rules/noarrayindexkey/",
        recommend: true,
    },
    {
        id: "noAsyncPromiseExecutor",
        descCn: "不允许使用异步函数作为Promise执行器。",
        descEn: "Disallows using an async function as a Promise executor.",
        url: "https://docs.rome.tools/lint/rules/noasyncpromiseexecutor/",
        recommend: true,
    },
    {
        id: "noCatchAssign",
        descCn: "不允许在catch子句中重新分配异常。",
        descEn: "Disallow reassigning exceptions in catch clauses.",
        url: "https://docs.rome.tools/lint/rules/nocatchassign/",
        recommend: true,
    },
    {
        id: "noCommentText",
        descCn: "阻止注释作为文本节点插入",
        descEn: "Prevent comments from being inserted as text nodes",
        url: "https://docs.rome.tools/lint/rules/nocommenttext/",
        recommend: true,
    },
    {
        id: "noCompareNegZero",
        descCn: "不允许与-0进行比较",
        descEn: "Disallow comparing against -0",
        url: "https://docs.rome.tools/lint/rules/nocomparenegzero/",
        recommend: true,
    },
    {
        id: "noConstEnum",
        descCn: "不允许在TypeScript中使用const enum",
        descEn: "Disallow TypeScript const enum",
        url: "https://docs.rome.tools/lint/rules/noconstenum/",
        recommend: true,
    },
    {
        id: "noDebugger",
        descCn: "不允许使用debugger",
        descEn: "Disallow the use of debugger",
        url: "https://docs.rome.tools/lint/rules/nodebugger/",
        recommend: true,
    },
    {
        id: "noDoubleEquals",
        descCn: "需要使用===和!==",
        descEn: "Require the use of === and !==",
        url: "https://docs.rome.tools/lint/rules/nodoubleequals/",
        recommend: true,
    },
    {
        id: "noDuplicateObjectKeys",
        descCn: "防止对象文字具有多个相同名称的属性声明。如果多次定义具有相同名称的对象属性（将getter和setter组合在一起时除外），则只有最后一个定义将其放入对象中，而忽略以前的定义，这很可能是一个错误。",
        descEn: "Prevents object literals having more than one property declaration for the same name. If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored, which is likely a mistake.",
        url: "https://docs.rome.tools/lint/rules/noduplicateobjectkeys/",
        recommend: true,
    },
    {
        id: "noDuplicateParameters",
        descCn: "不允许重复的函数参数名称",
        descEn: "Disallow duplicate function parameter name.",
        url: "https://docs.rome.tools/lint/rules/noduplicateparameters/",
        recommend: true,
    },
    {
        id: "noEmptyInterface",
        descCn: "不允许声明空接口。",
        descEn: "Disallow the declaration of empty interfaces.",
        url: "https://docs.rome.tools/lint/rules/noemptyinterface/",
        recommend: true,
    },
    {
        id: "noExplicitAny",
        descCn: "不允许any类型的使用。",
        descEn: "Disallow the any type usage.",
        url: "https://docs.rome.tools/lint/rules/noexplicitany/",
        recommend: true,
    },
    {
        id: "noExtraNonNullAssertion",
        descCn: "防止在TypeScript文件中错误使用非null断言运算符!。",
        descEn: "Prevents the wrong usage of the non-null assertion operator (!) in TypeScript files.",
        url: "https://docs.rome.tools/lint/rules/noextranonnullassertion/",
        recommend: true,
    },
    {
        id: "noFunctionAssign",
        descCn: "不允许重新分配函数声明。",
        descEn: "Disallow reassigning function declarations.",
        url: "https://docs.rome.tools/lint/rules/nofunctionassign/",
        recommend: true,
    },
    {
        id: "noImportAssign",
        descCn: "不允许分配给导入的绑定",
        descEn: "Disallow assigning to imported bindings",
        url: "https://docs.rome.tools/lint/rules/noimportassign/",
        recommend: true,
    },
    {
        id: "noLabelVar",
        descCn: "不允许与变量共享名称的标签",
        descEn: "Disallow labels that share a name with a variable",
        url: "https://docs.rome.tools/lint/rules/nolabelvar/",
        recommend: true,
    },
    {
        id: "noRedundantUseStrict",
        descCn: "防止有多余的“use strict”。",
        descEn: "Prevents from having redundant “use strict”.",
        url: "https://docs.rome.tools/lint/rules/noredundantusestrict/",
        recommend: false,
    },
    {
        id: "noShadowRestrictedNames",
        descCn: "禁止标识符隐藏受限制的名称。",
        descEn: "Disallow identifiers from shadowing restricted names.",
        url: "https://docs.rome.tools/lint/rules/noshadowrestrictednames/",
        recommend: true,
    },
    {
        id: "noSparseArray",
        descCn: "不允许稀疏数组",
        descEn: "Disallow sparse arrays",
        url: "https://docs.rome.tools/lint/rules/nosparsearray/",
        recommend: true,
    },
    {
        id: "noUnsafeNegation",
        descCn: "不允许使用不安全的否定。",
        descEn: "Disallow using unsafe negation.",
        url: "https://docs.rome.tools/lint/rules/nounsafenegation/",
        recommend: true,
    },
    {
        id: "useDefaultSwitchClauseLast",
        descCn: "强制switch语句中的默认子句为最后一个",
        descEn: "Enforce default clauses in switch statements to be last",
        url: "https://docs.rome.tools/lint/rules/usedefaultswitchclauselast/",
        recommend: true,
    },
    {
        id: "useValidTypeof",
        descCn: "此规则验证$expr一元表达式类型的结果是否与有效值进行比较，这些值可以是包含有效类型名的字符串文字，也可以是其他类型的表达式",
        descEn: "This rule verifies the result of typeof $expr unary expressions is being compared to valid values, either string literals containing valid type names or other typeof expressions",
        url: "https://docs.rome.tools/lint/rules/usevalidtypeof/",
        recommend: true,
    },
];

export interface NurseryRuleInfo extends BaseRuleInfo {
    id: keyof NurseryRulesConfig;
}

export const NurseryRuleList: NurseryRuleInfo[] = [
    {
        id: "noAriaUnsupportedElements",
        descCn: "强制不支持ARIA角色、状态和属性的元素不具有这些属性。",
        descEn: "Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.",
        url: "https://docs.rome.tools/lint/rules/noariaunsupportedelements/",
        recommend: false,
    },
    {
        id: "noAssignInExpressions",
        descCn: "不允许在表达式中进行赋值。",
        descEn: "Disallow assignments in expressions.",
        url: "https://docs.rome.tools/lint/rules/noassigninexpressions/",
        recommend: false,
    },
    {
        id: "noBannedTypes",
        descCn: "不允许使用某些类型。",
        descEn: "Disallow certain types.",
        url: "https://docs.rome.tools/lint/rules/nobannedtypes/",
        recommend: false,
    },
    {
        id: "noClassAssign",
        descCn: "不允许重新分配类成员",
        descEn: "Disallow reassigning class members.",
        url: "https://docs.rome.tools/lint/rules/noclassassign/",
        recommend: false,
    },
    {
        id: "noCommaOperator",
        descCn: "不允许使用逗号运算符。",
        descEn: "Disallow comma operator.",
        url: "https://docs.rome.tools/lint/rules/nocommaoperator/",
        recommend: false,
    },
    {
        id: "noConfusingArrow",
        descCn: "不允许箭头函数与比较混淆。",
        descEn: "Disallow arrow functions where they could be confused with comparisons.",
        url: "https://docs.rome.tools/lint/rules/noconfusingarrow/",
        recommend: false,
    },
    {
        id: "noConfusingLabels",
        descCn: "不允许使用非循环的带标签语句。",
        descEn: "Disallow labeled statements that are not loops.",
        url: "https://docs.rome.tools/lint/rules/noconfusinglabels/",
        recommend: false,
    },
    {
        id: "noConsoleLog",
        descCn: "不允许使用console.log",
        descEn: "Disallow the use of console.log",
        url: "https://docs.rome.tools/lint/rules/noconsolelog/",
        recommend: false,
    },
    {
        id: "noDuplicateCase",
        descCn: "不允许重复的case。如果switch语句在case子句中有重复的测试表达式，那么很可能是程序员复制了case子句，但忘记了更改测试表达式。",
        descEn: "Disallow duplicate case labels. If a switch statement has duplicate test expressions in case clauses, it is likely that a programmer copied a case clause but forgot to change the test expression.",
        url: "https://docs.rome.tools/lint/rules/noduplicatecase/",
        recommend: false,
    },
    {
        id: "noDuplicateClassMembers",
        descCn: "不允许重复的类成员。",
        descEn: "Disallow duplicate class members.",
        url: "https://docs.rome.tools/lint/rules/noduplicateclassmembers/",
        recommend: false,
    },
    {
        id: "noDuplicateJsxProps",
        descCn: "防止多次指定JSX属性。",
        descEn: "Prevents JSX properties to be assigned multiple times.",
        url: "https://docs.rome.tools/lint/rules/noduplicatejsxprops/",
        recommend: false,
    },
    {
        id: "noExtraLabels",
        descCn: "不允许使用不必要的标签。",
        descEn: "Disallow unnecessary labels.",
        url: "https://docs.rome.tools/lint/rules/noextralabels/",
        recommend: false,
    },
    {
        id: "noExtraSemicolons",
        descCn: "键入错误和对需要分号的地方的误解可能会导致不必要的分号。虽然从技术上讲这不是一个错误，但在读取代码时，额外的分号可能会造成混乱。",
        descEn: "Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code.",
        url: "https://docs.rome.tools/lint/rules/noextrasemicolons/",
        recommend: false,
    },
    {
        id: "noForEach",
        descCn: "推荐使用for...of,而不是Array.forEach。",
        descEn: "Prefer for…of statement instead of Array.forEach.",
        url: "https://docs.rome.tools/lint/rules/noforeach/",
        recommend: false,
    },
    {
        id: "noGlobalObjectCalls",
        descCn: "不允许将全局对象属性作为函数调用",
        descEn: "Disallow calling global object properties as functions",
        url: "https://docs.rome.tools/lint/rules/noglobalobjectcalls/",
        recommend: false,
    },
    {
        id: "noInferrableTypes",
        descCn: "不允许对使用文字表达式初始化的变量、参数和类属性使用类型注释",
        descEn: "Disallow type annotations for variables, parameters, and class properties initialized with a literal expression.",
        url: "https://docs.rome.tools/lint/rules/noinferrabletypes/",
        recommend: false,
    },
    {
        id: "noInnerDeclarations",
        descCn: "不允许在嵌套块中使用函数和var声明。",
        descEn: "Disallow function and var declarations in nested blocks.",
        url: "https://docs.rome.tools/lint/rules/noinnerdeclarations/",
        recommend: false,
    },
    {
        id: "noInvalidConstructorSuper",
        descCn: "防止在类内部错误地使用super()。它还检查扩展其他构造函数的类中是否缺少调用super()。",
        descEn: "Prevents the incorrect use of super() inside classes. It also checks whether a call super() is missing from classes that extends other constructors.",
        url: "https://docs.rome.tools/lint/rules/noinvalidconstructorsuper/",
        recommend: false,
    },
    {
        id: "noNamespace",
        descCn: "禁止使用TypeScript的namespace。",
        descEn: "Disallow the use of TypeScript’s namespaces.",
        url: "https://docs.rome.tools/lint/rules/nonamespace/",
        recommend: false,
    },
    {
        id: "noNoninteractiveElementToInteractiveRole",
        descCn: "强制不将交互式ARIA角色分配给非交互式HTML元素。",
        descEn: "Enforce that interactive ARIA roles are not assigned to non-interactive HTML elements.",
        url: "https://docs.rome.tools/lint/rules/nononinteractiveelementtointeractiverole/",
        recommend: false,
    },
    {
        id: "noNoninteractiveTabindex",
        descCn: "强制不将tabIndex分配给非交互式HTML元素。",
        descEn: "Enforce that tabIndex is not assigned to non-interactive HTML elements.",
        url: "https://docs.rome.tools/lint/rules/nononinteractivetabindex/",
        recommend: false,
    },
    {
        id: "noParameterAssign",
        descCn: "不允许重新分配函数参数。",
        descEn: "Disallow reassigning function parameters.",
        url: "https://docs.rome.tools/lint/rules/noparameterassign/",
        recommend: false,
    },
    {
        id: "noParameterProperties",
        descCn: "不允许在类构造函数中使用参数属性。",
        descEn: "Disallow the use of parameter properties in class constructors.",
        url: "https://docs.rome.tools/lint/rules/noparameterproperties/",
        recommend: false,
    },
    {
        id: "noPrototypeBuiltins",
        descCn: "不允许直接使用Object.prototype内置函数。",
        descEn: "Disallow direct use of Object.prototype builtins.",
        url: "https://docs.rome.tools/lint/rules/noprototypebuiltins/",
        recommend: false,
    },
    {
        id: "noRedeclare",
        descCn: "不允许在同一范围内重新声明变量、函数、类和类型。",
        descEn: "Disallow variable, function, class, and type redeclarations in the same scope.",
        url: "https://docs.rome.tools/lint/rules/noredeclare/",
        recommend: false,
    },
    {
        id: "noRedundantAlt",
        descCn: "强制img alt属性不包含单词“image”、“picture”或“photo”。",
        descEn: "Enforce img alt prop does not contain the word “image”, “picture”, or “photo”.",
        url: "https://docs.rome.tools/lint/rules/noredundantalt/",
        recommend: false,
    },
    {
        id: "noRedundantRoles",
        descCn: "强制显式角色属性与元素上的隐式/默认角色属性不同。",
        descEn: "Enforce explicit role property is not the same as implicit/default role property on an element.",
        url: "https://docs.rome.tools/lint/rules/noredundantroles/",
        recommend: false,
    },
    {
        id: "noRestrictedGlobals",
        descCn: "此规则允许您指定不希望在应用程序中使用的全局变量名。",
        descEn: "This rule allows you to specify global variable names that you don’t want to use in your application.",
        url: "https://docs.rome.tools/lint/rules/norestrictedglobals/",
        recommend: false,
    },
    {
        id: "noSelfAssign",
        descCn: "不允许双方完全相同的分配。",
        descEn: "Disallow assignments where both sides are exactly the same.",
        url: "https://docs.rome.tools/lint/rules/noselfassign/",
        recommend: false,
    },
    {
        id: "noSelfCompare",
        descCn: "不允许在双方完全相同的情况下进行比较。",
        descEn: "Disallow comparisons where both sides are exactly the same.",
        url: "https://docs.rome.tools/lint/rules/noselfcompare/",
        recommend: false,
    },
    {
        id: "noSvgWithoutTitle",
        descCn: "强制使用svg元素的title元素。",
        descEn: "Enforces the usage of the title element for the svg element.",
        url: "https://docs.rome.tools/lint/rules/nosvgwithouttitle/",
        recommend: false,
    },
    {
        id: "noSwitchDeclarations",
        descCn: "不允许在switch子句中使用词法声明。",
        descEn: "Disallow lexical declarations in switch clauses.",
        url: "https://docs.rome.tools/lint/rules/noswitchdeclarations/",
        recommend: false,
    },
    {
        id: "noUnreachableSuper",
        descCn: "如果类具有超类，则确保在访问类构造函数之前，在类构造函数中的每个代码路径上只调用一次super()构造函数",
        descEn: "Ensures the super() constructor is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass",
        url: "https://docs.rome.tools/lint/rules/nounreachablesuper/",
        recommend: false,
    },
    {
        id: "noUnsafeOptionalChaining",
        descCn: "不允许使用未定义值的上下文中使用可选链接。",
        descEn: "Disallow the use of optional chaining in contexts where the undefined value is not allowed.",
        url: "https://docs.rome.tools/lint/rules/nounsafeoptionalchaining/",
        recommend: false,
    },
    {
        id: "noUnusedLabels",
        descCn: "不允许使用未使用的标签",
        descEn: "Disallow unused labels.",
        url: "https://docs.rome.tools/lint/rules/nounusedlabels/",
        recommend: false,
    },
    {
        id: "noUselessCatch",
        descCn: "不允许使用不必要的catch子句。",
        descEn: "Disallow unnecessary catch clauses.",
        url: "https://docs.rome.tools/lint/rules/nouselesscatch/",
        recommend: false,
    },
    {
        id: "noUselessRename",
        descCn: "不允许将导入、导出和已销毁的赋值重命名为相同的名称。",
        descEn: "Disallow renaming import, export, and destructured assignments to the same name.",
        url: "https://docs.rome.tools/lint/rules/nouselessrename/",
        recommend: false,
    },
    {
        id: "noUselessSwitchCase",
        descCn: "不允许在switch语句中使用无用的case。",
        descEn: "Disallow useless case in switch statements.",
        url: "https://docs.rome.tools/lint/rules/nouselessswitchcase/",
        recommend: false,
    },
    {
        id: "noWith",
        descCn: "不允许使用非严格上下文中的语句。",
        descEn: "Disallow with statements in non-strict contexts.",
        url: "https://docs.rome.tools/lint/rules/nowith/",
        recommend: false,
    },
    {
        id: "useAriaPropTypes",
        descCn: "强制ARIA状态和属性值有效。",
        descEn: "Enforce that ARIA state and property values are valid.",
        url: "https://docs.rome.tools/lint/rules/useariaproptypes/",
        recommend: false,
    },
    {
        id: "useAriaPropsForRole",
        descCn: "强制具有ARIA角色的元素必须具有该角色所需的所有ARIA属性。",
        descEn: "Enforce that elements with ARIA roles must have all required ARIA attributes for that role.",
        url: "https://docs.rome.tools/lint/rules/useariapropsforrole/",
        recommend: false,
    },
    {
        id: "useCamelCase",
        descCn: "强制执行驼峰命名约定。",
        descEn: "Enforce camel case naming convention.",
        url: "https://docs.rome.tools/lint/rules/usecamelcase/",
        recommend: false,
    },
    {
        id: "useExhaustiveDependencies",
        descCn: "强制正确指定所有依赖项。",
        descEn: "Enforce all dependencies are correctly specified.",
        url: "https://docs.rome.tools/lint/rules/useexhaustivedependencies/",
        recommend: false,
    },
    {
        id: "useHookAtTopLevel",
        descCn: "强制所有React钩子都是从顶级组件函数调用的。",
        descEn: "Enforce that all React hooks are being called from the Top Level component functions.",
        url: "https://docs.rome.tools/lint/rules/usehookattoplevel/",
        recommend: false,
    },
    {
        id: "useIframeTitle",
        descCn: "强制使用元素iframe的属性title",
        descEn: "Enforces the usage of the attribute title for the element iframe",
        url: "https://docs.rome.tools/lint/rules/useiframetitle/",
        recommend: false,
    },
    {
        id: "useIsNan",
        descCn: "检查NaN时需要调用isNaN()。",
        descEn: "Require calls to isNaN() when checking for NaN.",
        url: "https://docs.rome.tools/lint/rules/useisnan/",
        recommend: false,
    },
    {
        id: "useLiteralKeys",
        descCn: "强制使用对属性的文字访问而不是计算属性访问。",
        descEn: "Enforce the usage of a literal access to properties over computed property access.",
        url: "https://docs.rome.tools/lint/rules/useliteralkeys/",
        recommend: false,
    },
    {
        id: "useMediaCaption",
        descCn: "强制音频和视频元素必须有一个字幕音轨。",
        descEn: "Enforces that audio and video elements must have a track for captions.",
        url: "https://docs.rome.tools/lint/rules/usemediacaption/",
        recommend: false,
    },
    {
        id: "useNamespaceKeyword",
        descCn: "需要使用namespace关键字而不是module关键字来声明TypeScript命名空间。",
        descEn: "Require using the namespace keyword over the module keyword to declare TypeScript namespaces.",
        url: "https://docs.rome.tools/lint/rules/usenamespacekeyword/",
        recommend: false,
    },
    {
        id: "useValidAriaProps",
        descCn: "确保ARIA属性ARIA-*都有效。",
        descEn: "Ensures that ARIA properties aria-* are all valid.",
        url: "https://docs.rome.tools/lint/rules/usevalidariaprops/",
        recommend: false,
    },
    {
        id: "useValidLang",
        descCn: "确保传递给lang属性的属性是正确的ISO语言和/或国家/地区。",
        descEn: "Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country.",
        url: "https://docs.rome.tools/lint/rules/usevalidlang/",
        recommend: false,
    },
    {
        id: "useYield",
        descCn: "要求生成器函数包含yield。",
        descEn: "Require generator functions to contain yield.",
        url: "https://docs.rome.tools/lint/rules/useyield/",
        recommend: false,
    },
];